﻿$(document).ready(function () {

    $('.state').addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all");

    $(".story").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")
			.find(".story-header")
				.addClass("ui-widget-header ui-corner-all")
				.end()
			.find(".story-content");

    $(".state").sortable({
        connectWith: '.state' /*,
            receive: function (event, ui) {
            var storyId = ui.item.find("#storyId").val();
            var stateId = $(this).find("#stateId").val();

     
            $.ajax({
            url: "../stories/move",
            data: { story: storyId, targetState: stateId },
            dataType: "json",
            success: function (data) {
            if (data.IsAllowed === false)
            $(ui.sender).sortable('cancel');
            $.jGrowl(data.ErrorMessage);
            },
            error: function (xhr, err, e) { alert("Error: " + err); }
            });
            }*/
    });

    $(".calendar").datepicker();

});


//http://www.erichynds.com/examples/jquery-notify/ notification system

